package cn.le.string;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;

/**
 * Created by admin on 2017/5/5.
 */
public class SimpleRead {

    //StringReader可以将String转化为可读的流对象
    public static BufferedReader input = new BufferedReader(new StringReader("sdf fdsfds \n321 32.13 "));

    public static void main(String[] args) {

        try {
            String name = input.readLine();
            System.out.println(name);

            String number = input.readLine();
            System.out.println(number);
            String[] numArray = number.split(" ");
            int age = Integer.parseInt(numArray[0]);
            double faorite = Double.parseDouble(numArray[1]);
            System.out.format("Hi %s\n",name);
            System.out.format("age: %d,faorite:%f\n",age,faorite);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
